import os

from xml.etree import ElementTree

def getresource(name):
    """parse an XML resource file into a dict of attributes"""
    res = {}
    fname = os.path.join("assets", "datafiles", (name + ".xml"))
    et = ElementTree.parse(fname)
    root = et.getroot()
    for key in root:
        res[key.tag] = key.text
    return res